home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / Source / Extension Shell 1.3 Folder / Extension Shell 1.3 ƒ / Sample Extensions / Bell Test ƒ / Tail-patching under System 7 < prev   
Encoding:
Text File  |  1994-04-04  |  2.9 KB  |  63 lines  |  [TEXT/R*ch]

  1. Since Extension Shell is intended for writing System 7 Extensions, I’ve included these posts from c.s.m.p.
  2. If you were worried about tail-patching in your Extensions, these might help clarify things for you. You
  3. can find these posts in Issue 153, Volume 1, of the C.S.M.P. Digest. They’re archived as:
  4.  
  5.             ftp.cs.uoregon.edu::/pub/mac/csmp-digest/v1/csmp-v1-153.txt
  6.  
  7.  
  8.  
  9.  
  10. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  11. From: greggor@apple.com (Greg L. Anderson)
  12. Subject: Some details on tail patching under System 7
  13. Date: 18 Jun 92 16:55:13 GMT
  14. Organization: Apple Computer Inc, Cupertino, CA
  15.  
  16. It appears that many people are still uncertain if it is okay to install a tail patch under System 7.  Here are
  17. a few words on the subject from some mail I sent to Bill Walburg regarding his question on tail patching.
  18.  
  19. - ----
  20.  
  21. To the best of my knowledge, you may Tail-patch every trap in System 7 _except_ for FrontWindow.  I'm
  22. not sure why that one is special; Dean Yu just said "don't do it".
  23.  
  24. System 7 has a new improved SetTrapAddress/GetTrapAddress mechanism that allows tail patching.  This
  25. mechanism did not exist in System 6. It works through a little bit of magic.  System come-from patches
  26. (the icky bug fixes that made tail patching inadvisable under System 6) are installed in a special magic way
  27. by the system.  They also include special magic that allows the system to determine if there is a
  28. come-from patch at the head of the trap pointer, and if there is, the system can get _and change_ the
  29. address of the routine that will be executed after the come-from patch.
  30.  
  31. If your trap patch is not installed using the special system magic (and it shouldn't be), then GetTrapAddress
  32. will return to you the address of the first function _after_ all of the come-from patches, and
  33. SetTrapAddress will install your routine _after_ all of the come-from patches.  Thus, your trap patch will
  34. not be "in the way" when the come-from patch is snooping up the stack.
  35.  
  36. - ----
  37.  
  38. Don't try this under any System prior to System 7.
  39.  
  40. =====================    ===========================
  41. Greg Anderson                Apple Computer, Inc.
  42. Macintosh Bodhisattva        Macintosh System Software
  43. greggor@apple.com            Finder Team
  44. =====================    ===========================
  45.  
  46.  
  47. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  48. From: nerm@apple.com (Dean Yu)
  49. Date: 27 Jun 92 01:16:18 GMT
  50. Organization: Apple Computer, Inc.
  51.  
  52. In article <68927@apple.Apple.COM>, greggor@apple.com (Greg L. Anderson) wrote:
  53. > To the best of my knowledge, you may Tail-patch every trap in System 7 _except_ for FrontWindow.  I'm
  54. > not sure why that one is special; Dean Yu just said "don't do it".
  55.  
  56. The mythical Layer Manager has a come from patch on FrontWindow that will not call through in some
  57. cases, so if you patch FrontWindow, your patch may not fire.  It's probably not worth the effort to try to
  58. work around it.
  59.  
  60. Dean Yu
  61. Blue Meanie, Negative Ethnic Role Model, etc.
  62. Apple Computer, Inc.
  63.